
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>icon-color</title>
    <link rel="stylesheet" href="demo.css">
    <script src="icon-color.js"></script>

    <style type="text/css">
        .icon {
          /* 通过设置 font-size 来改变图标大小 */
          width: 1em; height: 1em;
          /* 图标和文字相邻时，垂直对齐 */
          vertical-align: -0.15em;
          /* 通过设置 color 来改变 SVG 的颜色/fill */
          fill: currentColor;
          /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
             normalize.css 中也包含这行 */
          overflow: hidden;
        }

    </style>
</head>
<body>
    <div class="main markdown">
        <h1>icon-color 图标</h1>
        <ul class="icon_lists clear">
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-hegebiaozhun"></use>
                    </svg>
                    <div class="name">考试</div>
                    <div class="fontclass">#icon-hegebiaozhun</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bar-chart"></use>
                    </svg>
                    <div class="name">bar-chart</div>
                    <div class="fontclass">#icon-bar-chart</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-blog"></use>
                    </svg>
                    <div class="name">blog</div>
                    <div class="fontclass">#icon-blog</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shoucang"></use>
                    </svg>
                    <div class="name">收藏</div>
                    <div class="fontclass">#icon-shoucang</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-book-2"></use>
                    </svg>
                    <div class="name">书</div>
                    <div class="fontclass">#icon-book-2</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-blackboard-2"></use>
                    </svg>
                    <div class="name">黑板-2</div>
                    <div class="fontclass">#icon-blackboard-2</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-crayons"></use>
                    </svg>
                    <div class="name">蜡笔</div>
                    <div class="fontclass">#icon-crayons</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-cup"></use>
                    </svg>
                    <div class="name">奖杯</div>
                    <div class="fontclass">#icon-cup</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-abc"></use>
                    </svg>
                    <div class="name">abc</div>
                    <div class="fontclass">#icon-abc</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-medal"></use>
                    </svg>
                    <div class="name">奖章</div>
                    <div class="fontclass">#icon-medal</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-mortarboard-1"></use>
                    </svg>
                    <div class="name">学位帽</div>
                    <div class="fontclass">#icon-mortarboard-1</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-pencil-1"></use>
                    </svg>
                    <div class="name">铅笔</div>
                    <div class="fontclass">#icon-pencil-1</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shoucang1"></use>
                    </svg>
                    <div class="name">收藏</div>
                    <div class="fontclass">#icon-shoucang1</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-iconset-09"></use>
                    </svg>
                    <div class="name">考卷</div>
                    <div class="fontclass">#icon-iconset-09</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-id-321"></use>
                    </svg>
                    <div class="name">公告</div>
                    <div class="fontclass">#icon-id-321</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-luboxuexi"></use>
                    </svg>
                    <div class="name">录播学习</div>
                    <div class="fontclass">#icon-luboxuexi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-eye-vision-goal-plan-structure-define-think-watch-office-fcabecd"></use>
                    </svg>
                    <div class="name">思考，观察</div>
                    <div class="fontclass">#icon-eye-vision-goal-plan-structure-define-think-watch-office-fcabecd</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-cuotitubiao"></use>
                    </svg>
                    <div class="name">错题图标</div>
                    <div class="fontclass">#icon-cuotitubiao</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-user-girl"></use>
                    </svg>
                    <div class="name">用户（女）</div>
                    <div class="fontclass">#icon-user-girl</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shoucang2"></use>
                    </svg>
                    <div class="name">收藏</div>
                    <div class="fontclass">#icon-shoucang2</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-edit"></use>
                    </svg>
                    <div class="name">编辑</div>
                    <div class="fontclass">#icon-edit</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-position"></use>
                    </svg>
                    <div class="name">地址</div>
                    <div class="fontclass">#icon-position</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-set"></use>
                    </svg>
                    <div class="name">设置</div>
                    <div class="fontclass">#icon-set</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-user-boy"></use>
                    </svg>
                    <div class="name">用户（男）</div>
                    <div class="fontclass">#icon-user-boy</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-pc"></use>
                    </svg>
                    <div class="name">电脑</div>
                    <div class="fontclass">#icon-pc</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shoucang3"></use>
                    </svg>
                    <div class="name">收藏</div>
                    <div class="fontclass">#icon-shoucang3</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-gonggaoicon"></use>
                    </svg>
                    <div class="name">公告icon</div>
                    <div class="fontclass">#icon-gonggaoicon</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-business-color_board-"></use>
                    </svg>
                    <div class="name">business-color_board-30</div>
                    <div class="fontclass">#icon-business-color_board-</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-business-color_briefcase-"></use>
                    </svg>
                    <div class="name">business-color_briefcase-24</div>
                    <div class="fontclass">#icon-business-color_briefcase-</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-media-color-_camera-"></use>
                    </svg>
                    <div class="name">media-color-1_camera-18</div>
                    <div class="fontclass">#icon-media-color-_camera-</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-objects-color_diamond"></use>
                    </svg>
                    <div class="name">objects-color_diamond</div>
                    <div class="fontclass">#icon-objects-color_diamond</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-objects-color_globe"></use>
                    </svg>
                    <div class="name">objects-color_globe</div>
                    <div class="fontclass">#icon-objects-color_globe</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shopping-color_cart-modern-in"></use>
                    </svg>
                    <div class="name">shopping-color_cart-modern-in</div>
                    <div class="fontclass">#icon-shopping-color_cart-modern-in</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tech-color_desktop"></use>
                    </svg>
                    <div class="name">tech-color_desktop</div>
                    <div class="fontclass">#icon-tech-color_desktop</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tech-color_keyboard"></use>
                    </svg>
                    <div class="name">tech-color_keyboard</div>
                    <div class="fontclass">#icon-tech-color_keyboard</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tech-color_print"></use>
                    </svg>
                    <div class="name">tech-color_print</div>
                    <div class="fontclass">#icon-tech-color_print</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-dingdantongji--"></use>
                    </svg>
                    <div class="name">订单统计-01-01</div>
                    <div class="fontclass">#icon-dingdantongji--</div>
                </li>
            
        </ul>


        <h2 id="symbol-">symbol引用</h2>
        <hr>

        <p>这是一种全新的使用方式，应该说这才是未来的主流，也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
        这种用法其实是做了一个svg的集合，与另外两种相比具有如下特点：</p>
        <ul>
          <li>支持多色图标了，不再受单色限制。</li>
          <li>通过一些技巧，支持像字体那样，通过<code>font-size</code>,<code>color</code>来调整样式。</li>
          <li>兼容性较差，支持 ie9+,及现代浏览器。</li>
          <li>浏览器渲染svg的性能一般，还不如png。</li>
        </ul>
        <p>使用步骤如下：</p>
        <h3 id="-symbol-">第一步：引入项目下面生成的symbol代码：</h3>
        <pre><code class="lang-js hljs javascript"><span class="hljs-comment">&lt;script src="./icon-color.js"&gt;&lt;/script&gt;</span></code></pre>
        <h3 id="-css-">第二步：加入通用css代码（引入一次就行）：</h3>
        <pre><code class="lang-js hljs javascript">&lt;style type=<span class="hljs-string">"text/css"</span>&gt;
.icon {
   width: <span class="hljs-number">1</span>em; height: <span class="hljs-number">1</span>em;
   vertical-align: <span class="hljs-number">-0.15</span>em;
   fill: currentColor;
   overflow: hidden;
}
&lt;<span class="hljs-regexp">/style&gt;</span></code></pre>
        <h3 id="-">第三步：挑选相应图标并获取类名，应用于页面：</h3>
        <pre><code class="lang-js hljs javascript">&lt;svg <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"icon"</span> aria-hidden=<span class="hljs-string">"true"</span>&gt;<span class="xml"><span class="hljs-tag">
  &lt;<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#icon-xxx"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">use</span>&gt;</span>
</span>&lt;<span class="hljs-regexp">/svg&gt;
        </span></code></pre>
    </div>
</body>
</html>
